/* ==========================================================================
   Ignore List Modal
   ========================================================================== */

/* -------------------- Ignore Patterns/List Modal -------------------- */
.ignore-patterns-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.ignore-patterns-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1001;
  animation: fadeIn 0.2s ease-out; /* Fade in animation */
  background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
  backdrop-filter: blur(2px); /* Slight blur effect for depth */
  transition: opacity 0.2s ease; /* Smooth transition when closing */
}

.ignore-patterns-modal {
  background-color: var(--background-primary);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  width: 90%;
  max-width: 700px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  border: var(--standard-border);
  position: relative;
  z-index: 1002;
  animation: scaleIn 0.25s ease-out;
  /* Scale-in animation */
  transform-origin: center;
  /*Scalefromcenter*/
  will-change: transform, opacity;
  /*Optimizationforanimations*/
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
  -webkit-border-radius: 8px;
  -moz-border-radius: 8px;
  -ms-border-radius: 8px;
  -o-border-radius: 8px;
}

.ignore-patterns-header {
  margin-top: 10px;
  padding: var(--standard-padding);
  border-bottom: var(--standard-border);
  border-color: var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ignore-patterns-header h2 {
  margin: 0;
  margin-top: 10px;
  margin-bottom: 20px;
  margin-left: 25px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.save-button-ignore-patterns {
  margin-right: 20px;
  margin-bottom: 10px;
  color: var(--text-on-primary);
  background: var(--color-primary);
  border: 1px var(--border-color) solid;
  font-size: 15px;
  cursor: pointer;
  border-radius: var(--border-radius-md);
  -webkit-border-radius: var(--border-radius-md);
  -moz-border-radius: var(--border-radius-md);
  -ms-border-radius: var(--border-radius-md);
  -o-border-radius: var(--border-radius-md);
}

.save-button-ignore-patterns:hover {
  color: var(--text-primary);
  border-color: var(--color-primary);
  background-color: var(--hover-color);
}

.ignore-patterns-search {
  padding: 0 20px 12px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 12px;
}

.ignore-patterns-search .search-input {
  width: 100%;
  padding: 10px 14px;
  background-color: var(--background-secondary);
  border: 2px solid #000000; /* Changed from var(--border-color) to black */
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 15px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.ignore-patterns-search .search-input:hover {
  border-color: var(--color-primary-light);
  background-color: var(--background-primary);
  transform: translateY(-1px);
  box-shadow: var (--shadow-md);
}

.ignore-patterns-search .search-input:focus {
  border-color: var(--color-primary);
  outline: none;
  background-color: var(--background-primary);
  box-shadow: var(--focus-ring);
  transform: translateY(-1px);
}

.ignore-patterns-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
}

.ignore-patterns-sections {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.ignore-patterns-sections .ignore-patterns-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-md);
  background-color: var(--background-secondary);
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}

.ignore-patterns-sections .ignore-patterns-section:hover {
  border-color: var(--color-primary-light);
}

/* --- Section Header Flex Layout for Pattern Count --- */
.section-header {
  display: flex;
  gap: 12px;
}

.ignore-patterns-section h3 {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin: 0;
}

.ignore-patterns-section .pattern-count {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  padding: var(--space-xs) var(--space-sm);
  background-color: var(--background-primary);
  border-radius: var(--border-radius-pill);
  border: 1px solid var(--border-color);
}

.ignore-patterns-section .section-subtitle {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin-top: -8px;
  font-style: italic;
}

.pattern-list {
  background-color: var(--background-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: var(--space-md);
  margin: 0;
  font-family: var(--font-family-code);
  font-size: var(--font-size-sm);
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre;
  overflow-x: auto;
  max-height: 200px;
  transition: border-color var(--transition-fast);
}

.pattern-list:hover {
  box-shadow: var(--shadow-sm);
}

.ignore-patterns-error {
  color: var(--error-color);
  padding: 16px;
  background-color: var(--background-secondary);
  border-radius: 4px;
  font-size: 14px;
}

.ignore-patterns-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  color: var (--text-secondary);
  font-size: 14px;
}

.no-patterns {
  color: var(--text-secondary);
  font-style: italic;
  font-size: 14px;
  padding: 12px;
  background-color: var(--background-secondary);
  border-radius: 4px;
}

/* Custom Global Ignores Section (Dark Mode) - Matched to ignore-patterns-section */
.custom-global-ignores {
  display: flex;
  flex-direction: column;
  gap: var (--space-sm);
  padding: var(--space-md);
  background-color: var(--background-secondary);
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}

.custom-global-ignores:hover {
  border-color: var(--color-primary-light);
}

.custom-global-ignores h4 {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin: 0;
}

.custom-global-ignores .custom-ignore-input {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.custom-global-ignores input {
  flex-grow: 1;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  font-size: var(--font-size-sm);
  background-color: var(--background-primary);
  transition: all var(--transition-fast);
}

.custom-global-ignores input:hover {
  border-color: var(--border-color-focus);
}

.custom-global-ignores input:focus {
  border-color: var(--color-primary);
  box-shadow: var(--focus-ring);
  outline: none;
}

.add-pattern-button {
  background-color: var(--color-primary);
  color: var(--text-on-primary);
  border: 1px solid var(--color-primary-dark); /* Added distinct border */
  border-radius: var(--border-radius-md);
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.add-pattern-button:hover {
  color: var(--text-primary);
  border-color: var(--color-primary);
  background-color: var(--hover-color);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.add-pattern-button:active {
  transform: translateY(0);
}

.custom-global-ignores .custom-ignore-list ul {
  list-style: none;
  padding: 0;
  margin: var(--space-sm) 0 0 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.custom-global-ignores .custom-ignore-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  margin: 4px var(--space-md);
  background-color: #e8e8e8; /* Darker background for light mode */
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  transition: all var (--transition-fast);
  -webkit-border-radius: var(--border-radius-md);
  -moz-border-radius: var(--border-radius-md);
  -ms-border-radius: var(--border-radius-md);
  -o-border-radius: var(--border-radius-md);
  -webkit-transition: all var(--transition-fast);
  -moz-transition: all var(--transition-fast);
  -ms-transition: all var(--transition-fast);
  -o-transition: all var(--transition-fast);
}

.custom-global-ignores .custom-ignore-list li:hover {
  background-color: var(--hover-color);
  border-color: var(--color-primary-light);
}

.remove-pattern-button {
  background: none;
  border: none;
  color: var(--error-color);
  cursor: pointer;
  padding: var(--space-xs);
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
}

.remove-pattern-button:hover {
  background-color: rgba(231, 76, 60, 0.1);
}

.remove-pattern-button:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Dark mode specific styles for ignore patterns modal */
.dark-mode .ignore-patterns-modal {
  border-color: var(--border-color);
}

.dark-mode .pattern-list {
  border: 2px solid var(--border-color);
}

.dark-mode .ignore-patterns-error {
  background-color: rgba(231, 76, 60, 0.1);
}

/* ----------------- New Styles for Updated IgnorePatterns Modal ----------------- */
/* Mode explanation styling */
.ignore-mode-explanation {
  margin: 15px auto 20px auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background-color: var(--background-secondary);
  border-radius: 8px;
  padding: 16px;
  border: 1px solid var(--border-color);
  font-size: 14px;
}

.mode-description {
  padding: 12px;
  border-radius: 6px;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
  opacity: 0.7;
}

.mode-description.active {
  background-color: var(--background-primary);
  border-left-color: var(--color-primary);
  opacity: 1;
}

.mode-description h4 {
  margin: 0 0 8px 0;
  font-size: 15px;
  color: var(--text-primary);
}

.mode-description p {
  margin: 0;
  line-height: 1.5;
  color: var(--text-secondary);
}

.mode-description code {
  font-family: var(--font-family-code);
  background-color: var(--background-tertiary);
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 13px;
}

/* Toggle Switch for Ignore Mode */
.ignore-patterns-mode-toggle {
  display: flex;
  justify-content: center;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-left: 20px;
  padding-right: 20px;
}

.mode-toggle {
  display: inline-flex;
  align-items: center;
  background-color: var(--background-secondary);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mode-toggle button {
  flex: 1;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  transition:
    background-color 0.2s,
    color 0.2s;
}

.mode-toggle button.active {
  background-color: var(--color-primary);
  color: white;
}

.mode-toggle button:first-child {
  border-right: 1px solid var(--border-color);
}

/* Enhanced Search Input */
.ignore-patterns-search .search-input {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 15px;
  background-color: var(--background-secondary);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

/* Enhanced Custom Global Ignores Input & Button */
.custom-global-ignores .custom-ignore-input {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.custom-global-ignores input {
  flex-grow: 1;
  border: 1px solid var(--border-color); /* Use standard border color */
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
  background-color: var(--background-secondary);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  margin-bottom: 0; /* Remove bottom margin from input */
}
.custom-global-ignores input:hover {
  border-color: var(--border-color-focus);
}
.custom-global-ignores input:focus {
  border-color: var(--border-color-focus);
  box-shadow: var(--focus-ring);
  background-color: var(--background-primary);
}

/* Empty State */
.ignore-patterns-empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 16px;
  font-style: italic;
}
/* ToggleSwitch styles with light/dark mode support */
.modal-ignore-mode-toggle {
  position: relative;
  width: 180px; /* Reduced width */
  height: 36px; /* Reduced height */
  border-radius: 18px; /* Adjusted to match height */
  background-color: #7d7e84;
  cursor: pointer;
  user-select: none;
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px; /* Reduced padding for better centering */
}

.modal-ignore-mode-toggle-inner {
  position: absolute;
  top: 3px; /* Adjusted for better vertical centering */
  width: calc(50% - 6px); /* Adjusted width for better fit */
  height: calc(100% - 6px); /* Adjusted height for better fit */
  background-color: var(--color-primary); /* Using primary color (blue) */
  border-radius: 16px;
  transition:
    left 0.3s ease,
    background-color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 500;
  z-index: 1;
}

.modal-ignore-mode-toggle-inner.off {
  left: 3px; /* Adjusted for better alignment */
  background-color: var(--color-primary); /* Grey when off */
}

.modal-ignore-mode-toggle-inner.on {
  left: calc(50% + 3px); /* Adjusted for better alignment */
  background-color: var(--color-primary); /* Blue when on */
}

.modal-ignore-mode-toggle .toggle-label {
  font-size: 13px; /* Reduced font size */
  font-weight: 500;
  color: #ffffff;
  z-index: 2;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 47.3%;
  height: 100%;
}

.modal-ignore-mode-toggle .toggle-label.left {
  text-align: center;
}

.modal-ignore-mode-toggle .toggle-label.right {
  text-align: center;
}

.modal-ignore-mode-toggle .toggle-label.active {
  color: white; /* Bright white color for active text in light mode */
  font-weight: 600;
}

/* Dark mode adjustments */
.dark-mode .modal-ignore-mode-toggle {
  background-color: #2c2c2e;
  border-color: #3a3a3c;
}

.dark-mode .modal-ignore-mode-toggle-inner {
  background-color: var(--color-primary); /* Using primary color (blue) in dark mode */
}

.dark-mode .modal-ignore-mode-toggle-inner.off {
  background-color: var(--color-primary);
}

.dark-mode .modal-ignore-mode-toggle .toggle-label {
  color: var(--text-secondary);
}

.dark-mode .modal-ignore-mode-toggle .toggle-label.active {
  color: white; /* Keep active text bright white in dark mode too */
}

/* -------------------- Custom Global Ignores Section -------------------- */
.custom-global-ignores {
  margin: 16px 0;
}
.custom-global-ignores input {
  flex-grow: 1;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
  background-color: var(--background-secondary);
  transition: all 0.2s ease;
  margin-bottom: 0;
  margin-left: var(--space-md);
  margin-right: var(--space-md);
  box-shadow: var(--shadow-sm);
}

.custom-global-ignores input:hover {
  border-color: var(--color-primary-light);
  background-color: var(--background-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.custom-global-ignores input:focus {
  outline: none;
  border-color: var(--color-primary);
  background-color: var(--background-primary);
  box-shadow: var(--focus-ring);
  transform: translateY(-1px);
}

.custom-global-ignores .add-pattern-btn {
  width: 100%;
  margin-bottom: 12px;
  margin-right: 20px;
}

.custom-global-ignores ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.custom-global-ignores li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  margin: 4px var(--space-md);
  background-color: #e8e8e8; /* Darker background for light mode */
  border: 1px solid var(--border-color);
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.dark-mode .custom-global-ignores li {
  background-color: var(--background-secondary); /* Keep the same for dark mode */
  border: 1px solid var(--border-color);
}

.custom-global-ignores li button {
  color: var(--error-color);
  background: none;
  padding: 4px;
  cursor: pointer;
  border-radius: 8px;
  font-size: 12px;
  height: auto;
  border: none;
  -webkit-border-radius: 8px;
  -moz-border-radius: 8px;
  -ms-border-radius: 8px;
  -o-border-radius: 8px;
}

.custom-global-ignores li button:hover {
  opacity: 0.8;
  background-color: rgba(231, 76, 60, 0.1); /* Light red background on hover */
}

.custom-global-ignores .custom-ignore-list h4 {
  margin-left: var(--space-lg); /* Added margin left using space variable */
  margin-right: var(--space-lg); /* Added margin right using space variable */
  margin-bottom: 8px;
  font-size: 15px;
  color: var(--text-primary);
  padding: 10px 12px; /* Increased padding top and bottom from 6px to 10px */
  transition: all 0.2s ease;
  display: inline-block;
  border: 2px solid transparent;
  background-color: var(--background-tertiary);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.custom-global-ignores .custom-ignore-list h4:focus-visible {
  outline: none;
  background-color: var(--background-primary);
  box-shadow: 0 0 0 2px rgba(14, 99, 156, 0.3); /* Blue focus ring */
  transform: translateY(-2px);
}

.custom-global-ignores h4 {
  margin-left: var(--space-md); /* Added margin left using space variable */
  margin-right: var(--space-md); /* Added margin right using space variable */
  margin-bottom: 10;
  padding: 12px 12px; /* Increased padding top and bottom from 8px to 12px */
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  background-color: var(--background-secondary);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.custom-global-ignores h4:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-primary);
}
